<template>
  <div>
    <span>about</span>
    <i class="iconfont icon-gengduomore"></i>
    <span class="iconfont icon-tongxunlu"></span>
    <i class="iconfont">&#xe6b1;</i>
  </div>
</template>

<script>
export default {
  name: "About",
};
let p1 = new Promise((resolve, reject) => {
  let flag = Math.random() > 0.5 ? true : false;
  console.log("flag:", flag);
  if (flag) {
    resolve(flag);
  } else {
    reject("出错了");
  }
});
// @2 使用then方法进行链式的调用
p1.then((res) => {
  console.log("res:", res);
  return res;
})
  .then((result) => {
    console.log("result1:", result);
    return "hello";
  })
  .then((result) => {
    console.log("result2:", result);
  });

p1.catch((res) => {
  console.log("catch:", res);
});
</script>

<style>
.iconfont {
  margin-right: 10px;
  font-size: 50px;
  color: #d5c55c;
}
</style>
